
/**
 * Created by xiongshilin on 2017/3/28.
 */
(function(){
    AGEF.RootControl = function(){
        AGEF.RootControl.superclass.constructor.call(this, null);
    };
    var superClass = AGEF.Composite;
    COM.util.defineClass(AGEF.RootControl, superClass, {
        getLabel: function() {
            return "RootControl";
        },
        createDomElement: function() {
            var element = document.createElement("div");
            element.id = "rootcontrol";
            element.style.position="absolute";
            element.style.top="0px";
            element.style.left="0px";
            element.style.width="100%";
            element.style.height="100%";
            this.domElement = element;
        },
        setWidth:function(width) {
            if(this.domElement) {
                this.domElement.style.width = width + "px";
            }
        },
        setHeight:function(height) {
            if(this.domElement) {
                this.domElement.style.height = height + "px";
            }
        },
        setSize: function(width, height) {
            if(this.domElement) {
                this.domElement.style.width = width + "px";
                this.domElement.style.height = height + "px";
            }
        },
        appendDomChild: function(domChild) {
            COM.util.HTMLUtil.addChild(this.domElement, domChild);
        },
        removeDomChild: function(domChild) {
            COM.util.HTMLUtil.removeChild(domChild);
        },
        getDomElement: function(){
            if(!this.domElement) {
                this.createDomElement();
            }
            return this.domElement;
        }
    });
})();